﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[Serializable]
public class EquipJianLianUp
{
    /// <summary>
    /// 精炼等级
    /// </summary>
    public int level;
    /// <summary>
    /// 武器加成
    /// </summary>
    public int weapon_value;
    /// <summary>
    /// 衣服加成   
    /// </summary>
    public int clothes_value;
    /// <summary>
    /// 戒指加成
    /// </summary>
    public int ring_value;
    /// <summary>
    /// 鞋子加成
    /// </summary>
    public int shoe_value;

    public int GetValue(int pos)
    {
        if (pos == 1)
        {
            return weapon_value;
        }
        else if (pos == 2)
        {
            return clothes_value;
        }
        else if (pos == 3)
        {
            return ring_value;
        }
        else
        {
            return shoe_value;
        }
    }
}

public class EquipJianLianUpMgr
{
    public static Dictionary<long, EquipJianLianUp> Dict { get; private set; }

    public static void Load()
    {
        List<EquipJianLianUp> initRoles = StaticDataReader.LoadJsonFromFile<EquipJianLianUp>("static_equip_jinglian_up");
        if (initRoles != null)
        {
            Dict = new Dictionary<long, EquipJianLianUp>(initRoles.Count);
            for(int i=0; i<initRoles.Count; i++)
            {
                Dict.Add(initRoles[i].level, initRoles[i]);
            }
        }
        else
        {
            Dict = new Dictionary<long, EquipJianLianUp>();
        }
    }
}
